function fig62

%  solve IVP using MATLAB routines
%         y' = f(t,y)  with   y(0) = y0
%  where y = (y1, y2, y3 , ..., yn) is an n-vector

clf
% get(gcf)
set(gcf,'Position', [25 1115 658 230])
subaxis(1,1,1,1,'MT',0.01,'MB',0.18,'MR',-0.02,'ML',0.03,'P',0.04)

hold on

for i=1:2
    % time interval
    tmax=20;

    if i==1
        y10=0; y20=1;
        y0=[y10 y20];
        i1=30; ii1=i1+1;
        i2=50; ii2=i2+1;
    else
        y10=2; y20=0;
        y0=[y10 y20];
        i1=30; ii1=i1+1;
        i2=50; ii2=i2+1;
    end

    %  calculate solution using a MATLAB routine
    [t,y] = ode45(@rhs,[0 tmax],y0);
    %[t,y] = ode23s(@rhs,[0 tmax],y0);
    plot(y(:,1),y(:,2),'b','LineWidth',1.1)
    plot(y(1,1),y(1,2),'.b','Markersize',20)
    arrowhead([y(i1,1) y(ii1,1)],[y(i1,2) y(ii1,2)],'b',[1.8 2.2]);
    arrowhead([y(i2,1) y(ii2,1)],[y(i2,2) y(ii2,2)],'b',[1.8 2.2]);
end

axis([-1.5 2 -2 1]);
% commands to label each axes
grid on
box on
set(gca,'FontSize',12)
xlabel('$x$-axis','Interpreter','latex','FontSize',14)
ylabel('$v$-axis','Interpreter','latex','FontSize',14)

hold off

exportgraphics(gca,'/Users/mark/Desktop/fig62.pdf')


%  define f(t,y)
function dy=rhs(t,y)
dy=zeros(2,1);
b=0.25; lam=1;
dy(1) = y(2);
dy(2) = -2*b*y(2) + lam*y(1) - y(1)^3;













